require(devtools) install_github("SWotherspoon/SGAT") install_github("SWotherspoon/BAStag") install_github("eldarrak/FLightR") # note the version library(BAStag) library(FLightR)
Here I use FLightR after initial twilight detection by BAStag. First we start with downloading the .lux file .lux file into your working directory. I assume you will name it 'A2_raw_data.lux'. 2. open R and process .lux file
d.lux<-readMTlux("A2_raw_data.lux") d.lux<- subset(d.lux,select=c("Date","Light"))
In the lux file light values go very high, so we should log transform data before selecting twilights.
d.lux$Light<-log(d.lux$Light)
now we plot the image and select offset
offset = 10 lightImage(d.lux, offset = offset, zlim = c(0, 12), dt = 300) # dt specifies the recording interval threshold=1.5 # better use 1.5 for Intigeo tags if no strong reason for other value twl <- preprocessLight(d.lux, threshold, offset = offset,lmax=12) # only needs to be done once
Transfer BAStag output to TAGS format...
library(FLightR) TAGS.twilights<-BAStag2TAGS(d.lux, twl, threshold=1.5) TAGS.twilights$light<-exp(TAGS.twilights$light) # this is needed only if you log transformed in the beginning.. save(TAGS.twilights, file="TAGS.twilights.RData")
Now you can read these data by FLightR.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.